<?php

/**
 * Description of PageModel
 *
 * @author Ian Clarence <ian.clarence@gmail.com>
 */
final class PageModel extends Page {

    /**
     * The constructor.
     */
    public function __construct(array $fields = array()) {
        parent::__construct($fields);
    }

    /**
     * Getting page parameters for passing into a view.
     *
     * @return array
     */
    public function getViewFields() {
        $viewFields = parent::getViewFields();
        $pageNumber = self::getCurrentPageNumber();
        $article = self::getCurrentPageArticle();
        $fileExtension = self::getCurrentPagePseudoFile();
        if (is_array($viewFields['page'])) {
            $name = $viewFields['page']['name'];
        }

        /**
         * Page specific data.
         */
        if (is_array($viewFields['page'])) {
            $viewFields['page']['page_number'] = $pageNumber;
            $viewFields['page']['article'] = $article;
            $viewFields['page']['file_extension'] = $fileExtension;
        }
        $viewFields['test'] = Registry::getFlds('MULTILINGUAL_SITE');
        return $viewFields;
    }

}